# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=liblqr
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.4.2
pkgrel=4
pkgdesc="A seam-carving C/C++ library called Liquid Rescale (mingw-w64)"
arch=('any')
url="https://liblqr.wikidot.com/"
license=("GPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-glib2")
options=('staticlibs' 'strip')
source=(${_realname}-${pkgver}.tar.gz::https://github.com/carlobaldassi/liblqr/archive/v${pkgver}.tar.gz)
sha256sums=('1019a2d91f3935f1f817eb204a51ec977a060d39704c6dafa183b110fd6280b0')

build() {
  [[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST}
  mkdir -p build-${MINGW_CHOST} && cd build-${MINGW_CHOST}
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install
}
